/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package actioncombination.problem.gridworld;

import actioncombination.logic.agent.*;
import actioncombination.common.datastructure.*;
import actioncombination.common.value.Point2DIntegerValue;
import actioncombination.common.value.Value;
import actioncombination.logic.environment.*;


/**
 *
 * @author Administrador
 */
public class AgentStateImpl extends AgentState {
    protected RLEnvironmentState world;
    private Point2DIntegerValue position;
    private Value velocity;
    private Value angle;
    

    @Override
    public Object clone() {
        throw new UnsupportedOperationException("Not supported yet.");        
    }

    
    public void initState() {
        //CHOCHO
        
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public String toString() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public boolean equals(Object obj) {
        //CHOCHO
        throw new UnsupportedOperationException("Not supported yet.");
    }

      public Point2DIntegerValue getPosition() {
        return position;
    }

    public void setPosition(Point2DIntegerValue position) {
        this.position = position;
    }

    public Value getVelocity() {
        return velocity;
    }

    public void setVelocity(Value velocity) {
        this.velocity = velocity;
    }

    public Value getAngle() {
        return angle;
    }

    public void setAngle(Value angle) {
        this.angle = angle;
    }
    
    public boolean salidaAlcanzada(){
        throw new UnsupportedOperationException("Not supported yet");
    }
    
     public boolean noHayMasTargets() {
        for (int fil = 0; fil < getWorld().getBinsX(); fil++) {
            for (int col = 0; col < getWorld().getBinsY(); col++) {
                if (getWorld().getHere(fil, col) == PerceptionImpl.PERCEPTION_TARGET) {
                    return false;
                }
            }
        }
        return true;
    }
     
    public int getObjetivosNoVisitados() {
        int resultado = 0;

        for (int fil = 0; fil < getWorld().getBinsX(); fil++) {
            for (int col = 0; col < getWorld().getBinsY(); col++) {
                if (getWorld().getHere(fil, col)== PerceptionImpl.PERCEPTION_TARGET) {
                    resultado++;
                }
            }
        }
        return resultado;
    }
       
    public boolean isTerminal(){
        //CHOCHO
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public RLEnvironmentState getWorld() {
        return world;
    }

    public void setWorld(RLEnvironmentState world) {
        this.world = world;
    }

   
    }
    
    
    

